import { request } from "@/utils/http";
import { HospitalSetValue, ReqHospital, ReqHospitalAdd, ReqHospitalSetValue, UpdateHospital } from "./Model/HospitalSetType";

// 获取医院分页列表
export function getHoapitalList({ page, limit, hoscode, hosname }: ReqHospital) {
    return request.get<any, HospitalSetValue>(`/admin/hosp/hospitalSet/${page}/${limit}`, {
        params: {
            hoscode, hosname
        }
    })
}
// 田间医院数据
export function HoapitalAdd(obj:ReqHospitalAdd){
    return request.post<any,null>("/admin/hosp/hospitalSet/save",obj)
}
// 根据ID查询医院数据
export function getHoapitalById(id:string){
    return request.get<any,HospitalSetValue>(`/admin/hosp/hospitalSet/get/${id}`)
}
// 修改医院数据
export function UpdateHospitalSet(hospitalSet:UpdateHospital){
    return request.put<any,null>("/admin/hosp/hospitalSet/update",hospitalSet)
}
// 单个删除医院
export function delHospital(id:string){
    return request.delete<any,null>(`/admin/hosp/hospitalSet/remove/${id}`)
}
//批量删除医院
export function delHospitalList(idList:React.Key[]){
    return request.delete<any,null>("/admin/hosp/hospitalSet/batchRemove",{
       data: idList
    })
}